﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;

public class TestManager : MonoBehaviour
{
    public float evolutionSpeed;
    public float perTime;
    private float t;
    
    void Awake()
    {
        Physics.autoSimulation = false;
    }
    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        Time.timeScale = evolutionSpeed;
        t += Time.deltaTime;
        if (t > perTime)
        {
            KillAll();
            t = 0;
        }
    }

    void KillAll()
    {
        FindObjectsOfType<AnimalCtrl>().ToList().ForEach(a => a.health = 0);
    }
}
